import { Component,Input} from '@angular/core';
// ,Output, EventEmitter

/**
 * Generated class for the HlistComponent component.
 *
 * See https://angular.io/api/core/Component for more info on Angular
 * Components.
 */
@Component({
  selector: 'hlist',
  templateUrl: 'hlist.html'
})
export class HlistComponent {

  // text: string;

  constructor() {
    // console.log('Hello HlistComponent Component');
    // this.text = 'Hello World';
  }
  // 数据从父类获取
    @Input('data') data: string;
    @Input('events') events: any;

    onEvent = (event: string, item: any): void => {
        if (this.events[event]) {
            this.events[event](item);
        }
    }

}
